import { createI18n } from 'vue-i18n'
import messages from './messages'

// 拿到缓存
const locale = localStorage.getItem('locale') ?? 'zh'

const i18n = createI18n({
  locale,
  messages
})

export const t = (...args) => {
  return i18n.global.t(...args)
}

export default i18n